package com.certificationManager.client.view;

import com.certificationManager.client.i18n.AppConstants;
import com.certificationManager.client.presenter.Content;
import com.certificationManager.client.presenter.Footer;
import com.certificationManager.client.presenter.LeftMenu;
import com.certificationManager.client.presenter.view_interface.IMainStructureView;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HasVerticalAlignment;

public class MainStructureView extends Composite implements IMainStructureView {

	/** Internationalization */
	AppConstants i18n = GWT.create(AppConstants.class);
	
	/** Services */
	
	/** Fields */
	final FlexTable main = new FlexTable();
	final ContentPanel leftMenu = new LeftMenu();
	final TopView top = new TopView();
	final Panel footer = new Footer();
	final Panel content = new Content();
	
	public MainStructureView() {
		
		main.setCellSpacing(10);
		main.setWidth("100%");
		main.setHeight("100%");
		
		main.setWidget(0, 0, top);
		main.setWidget(1, 0, leftMenu);
		main.setWidget(1, 1, content);
		main.setWidget(2, 0, footer);
		
		main.getFlexCellFormatter().setColSpan(0, 0, 2);
		main.getFlexCellFormatter().setColSpan(2, 0, 2);
		main.getFlexCellFormatter().setHeight(0, 0, "91px");
		main.getFlexCellFormatter().setHeight(2, 0, "50px");
		main.getFlexCellFormatter().setWidth(1, 0, "250px");

		main.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
		
		initWidget(main);
	}
	
	@Override
	public Widget getViewWidget() {
		return this;
	}
	
	@Override
	public TopView getTopView() {
		return this.top;
	}
	
}
